package com.lhf.fvscommon.entity;

import java.io.Serializable;
import java.util.List;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiParam;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

/**
 * 权限表(SysPer)实体类
 *
 * @author lhf
 * @since 2020-10-26 10:57:10
 */
@ApiModel("")
public class SysPer extends Page implements Serializable {
    private static final long serialVersionUID = -56556394054677397L;

    @ApiModelProperty(value = "权限id")
    @TableId(type = IdType.AUTO)
    @ApiParam(defaultValue = "-1")
    private Integer perId;
    @ApiModelProperty(value = "权限")
    private String per;
    @ApiModelProperty(value = "菜单名字")
    private String menuName;
    @ApiModelProperty(value = "类型，0 菜单 1按钮")
    private Integer menuType;
    @ApiModelProperty(value = "菜单图标")
    private String menuIco;
    @ApiModelProperty(value = "排序")
    private Integer menuSort;
    @ApiModelProperty(value = "父类id，默认0，一级菜单")
    private Integer parentId;
    @ApiModelProperty(value = "子级分类")
    @TableField(exist = false)
    private List<SysPer> children;

    public Integer getPerId() {
        return perId;
    }

    public void setPerId(Integer perId) {
        this.perId = perId;
    }

    public String getPer() {
        return per;
    }

    public void setPer(String per) {
        this.per = per;
    }

    public String getMenuName() {
        return menuName;
    }

    public void setMenuName(String menuName) {
        this.menuName = menuName;
    }

    public Integer getMenuType() {
        return menuType;
    }

    public void setMenuType(Integer menuType) {
        this.menuType = menuType;
    }

    public String getMenuIco() {
        return menuIco;
    }

    public void setMenuIco(String menuIco) {
        this.menuIco = menuIco;
    }

    public Integer getMenuSort() {
        return menuSort;
    }

    public void setMenuSort(Integer menuSort) {
        this.menuSort = menuSort;
    }

    public Integer getParentId() {
        return parentId;
    }

    public void setParentId(Integer parentId) {
        this.parentId = parentId;
    }

    public List<SysPer> getChildren() {
        return children;
    }

    public void setChildren(List<SysPer> children) {
        this.children = children;
    }

    @Override
    public String toString() {
        return "SysPer{" +
                "perId=" + perId +
                ", per='" + per + '\'' +
                ", menuName='" + menuName + '\'' +
                ", menuType=" + menuType +
                ", menuIco='" + menuIco + '\'' +
                ", menuSort=" + menuSort +
                ", parentId=" + parentId +
                ", children=" + children +
                '}';
    }

//    /**
//     * 判断是否为空
//     *
//     * @return
//     */
//    public boolean isNull() {
//
//        return this.perId == null && StringUtils.isBlank(this.per) && StringUtils.isBlank(this.menuName)
//                && StringUtils.isBlank(this.menuIco)
//                && this.parentId == null;
//    }

}